<?php

/**
 * Libraries_Common File
 * 
 * Short file description
 *
 * PHP Version: 5.3.26
 * 
 * @category Libraries_Common
 * @package  Libraries_Common_Package
 * @author   
 * @license  
 * @link     
 */

// put your namespace and use here

/**
 * Libraries_Common class
 * 
 * Class description
 *
 * @category Libraries_Common_Controller
 * @package  Libraries_Common_Package
 * @author   
 * @license  
 * @link     
 */

class Common 
{


	/**
	  * Sample function comment
	  *
	  * @param string 
	  * @param int    
	  *
	  * @return void
	  */

	public static function globalXssClean()
	{
	    // Recursive cleaning for array [] inputs, not just strings.
	    $sanitized = static::arrayStripTags(Input::get());
	    Input::merge($sanitized);
	}


	/**
	  * Sample function comment
	  *
	  * @param string 
	  * @param int    
	  *
	  * @return void
	  */

	public static function arrayStripTags($array)
	{
	    $result = array();
	 
	    foreach ($array as $key => $value) {
	        // Don't allow tags on key either, maybe useful for dynamic forms.
	        $key = htmlentities($key);
	 
	        // If the value is an array, we will just recurse back into the
	        // function to keep stripping the tags out of the array,
	        // otherwise we will set the stripped value.
	        if (is_array($value)) {
	            $result[$key] = static::arrayStripTags($value);
	        } else {
	            // I am using strip_tags(), you may use htmlentities(),
	            // also I am doing trim() here, you may remove it, if you wish.
	            $result[$key] = trim(htmlentities($value));
	        }
	    }
	 
	    return $result;
	}


}
